home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / STANDALO / DB6 / DB6OCTOB.ER_ next >
Text File  |  1990-10-26  |  3KB  |  21 lines

  1.  
  2. MDV Ocotober Hack APPLICATION
  3. -----------
  4.    SCREEN NAME:DB6
  5.     ENTRY NAME:ShiftKey()
  6.  
  7.     FIRST NAME:Don
  8.      LAST NAME:Bachner
  9. STREET ADDRESS:1641 Elk Valley Dr.
  10.           CITY:Evergreen
  11.          STATE:CO
  12.            ZIP:80439
  13.        PHONE #:303-573-9667
  14.  
  15.       COMMENTS:ShiftKey() is an XFCN which returns 'true' if the shiftKey is down or 'false' if it isn't. Although HyperCard has no need for this XFCN,MichrophoneII does.  MichrophoneII has a scripting language which I used to build an application (a large group of scripts) that would allow me and other employees at Federal Express to interface with a company IBM 3270 at home. Within this series of scripts  are different modules such as E-Mail and an IMS system. Instead of having to memorize a million different keyboard commands, each module is set up with a series of icons at the bottom of the screen which are clearly labeled as to their function. Each user has a UserProfile  which are a series of global variables with EmpID,Passwords,Preferences, etc. 
  16.  
  17. Ok, why ShiftKey()? The way MichII works is similar to HyperCard. When the user clicks on a Icon if that Icon has a script associated with it, then the script executes. Many of the commands used with the 3270 require Employee Id and other facts about the employee.  The problem was suppose you want info about another employee or another city that you are not domiciled in? The only way to do it was to look up the commands and supply the information or change parts of your userProfile. Thus, using ShiftKey() allows the scripts to branch to a more generic type of script which prompts the user for the different information required.
  18.  
  19. ShiftKey() was written with ThinkC4.0 and all the code along with the resource containing the XFCN are include in this file. ShiftKey() is the first real program that I have written in "C" and I basicly taught myself (over last 4 months) using DMark's books MacProgramming PrimerVol1&2. Prior to learning "C" the only other languages I had worked with are HyperCard and Foxbase. 
  20.  
  21. Obviously the code for ShiftKey() is nothing very sophisticated. The hardest part was figuring out what kind of event to trap for because MichrophoneII uses the commandKey and mouseDown combination to put you into the script editor. Thus if you trap for a mouseDown your out of luck because it's already been flushed from the EventQue by MichII. Trapping for a keyDown does not work either because again MichII is looking for the commandKey or optionKey(gets you inot Icon editor). The way to do it is to trap for a mouseUp instead and then check the modifiers field for the shiftKey. The neat thing for me was that mouseUps are rarely ever trapped for but in this case it was just the thing!